package com.sjms._02_创建_工厂方法;

/**
 * 咖啡工厂
 */
class CoffeeFactory {

    public static Coffee createCoffee(String type) {
        Coffee c = null;
        switch (type) {
            case "星巴克":
                c = new 星巴克("星巴克");
                break;
            case "雀巢":
                c = new 雀巢("雀巢");
                break;
            default:
                System.out.println(type + ": 不存在！！！");
                break;
        }
        return c;
    }

}
